package org.lagou.tools;

import java.util.Properties;
import javax.sql.DataSource;
import com.alibaba.druid.pool.DruidDataSourceFactory;

public class DBTools {
	//数据连接池
	public static DataSource ds;
	//初始化连接池
	static {
		Properties properties=new Properties();
		try {
			properties.load(DBTools.class.getResourceAsStream("/druid.properties"));
			
			//DataSource就是连接池对象
			ds=DruidDataSourceFactory.createDataSource(properties);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}